<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>传智健康</title>
    <meta name="description" content="传智健康">
    <meta name="keywords" content="传智健康">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <link rel="stylesheet" href="../css/style.css">
    <script src="../plugins/echarts/echarts.js"></script>
</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>统计分析<small>体检收入统计</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>统计分析
            </el-breadcrumb-item>
            <el-breadcrumb-item>体检收入统计</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <el-form label-position="right" label-width="100px" :model="formData">
        <div class="footer">
            <h3>状态变化趋势</h3>
            <el-date-picker v-model="formData.start" type="date" placeholder="选择开始时间"></el-date-picker>
            <el-date-picker v-model="formData.end" type="date" placeholder="选择结束时间"></el-date-picker>
            <el-button @click="getEcharts" type="success">查询</el-button>
        </div>
    </el-form>
    <div class="app-container">
        <div class="box">
            <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
            <div id="chart3" style="height:500px;width:1200px"></div>
        </div>
    </div>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    new Vue({
        el: '#app',
        data: {
            formData: {
                start: '',
                end: ''
            },

        },
        created() {
            axios.post("/report/setMealIncome1.do").then((res) => {
                var myChart1 = echarts.init(document.getElementById('chart3'));
                myChart1.setOption({
                    title: {
                        text: '套餐收入占比',
                        subtext: '',
                        x: 'center'
                    },
                    tooltip: {//提示框组件
                        trigger: 'item',//触发类型，在饼形图中为item
                        formatter: "{a} <br/>{b} : {c} ({d}%)"//提示内容格式
                    },
                    legend: {//左上角图例
                        orient: 'vertical',
                        left: 'left',
                        data: res.data.data.setMealNames
                    },
                    series: [//数据系列 {"data":{"setMealIncome":[{"name":"入职无忧体检套餐（男女通用）","value":300.0},{"name":"粉红珍爱(女)升级TM12项筛查体检套餐","value":4800.0},{"name":"阳光爸妈升级肿瘤12项筛查（男女单人）体检套餐","value":2800.0},{"name":"珍爱高端升级肿瘤12项筛查（男女单人）","value":4800.0},{"name":"总收入","value":12700}],"setMealNames":["入职无忧体检套餐（男女通用）","粉红珍爱(女)升级TM12项筛查体检套餐","阳光爸妈升级肿瘤12项筛查（男女单人）体检套餐","珍爱高端升级肿瘤12项筛查（男女单人）","总收入"]},"flag":true,"message":"预约统计数据成功"}
                        {
                            name: '套餐收入占比',
                            type: 'pie',//饼形图
                            radius: '55%',
                            center: ['50%', '60%'],
                            data: res.data.data.setMealIncome,
                            itemStyle: {
                                emphasis: {
                                    shadowBlur: 10,
                                    shadowOffsetX: 0,
                                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                                }
                            }
                        }
                    ]
                });
            })
        },

        methods: {
            getEcharts(){
                axios.post("/report/setMealIncome.do", this.formData).then((res) => {
                    var myChart1 = echarts.init(document.getElementById('chart3'));
                    myChart1.setOption({
                        title: {
                            text: '套餐收入占比',
                            subtext: '',
                            x: 'center'
                        },
                        tooltip: {//提示框组件
                            trigger: 'item',//触发类型，在饼形图中为item
                            formatter: "{a} <br/>{b} : {c} ({d}%)"//提示内容格式
                        },
                        legend: {//左上角图例
                            orient: 'vertical',
                            left: 'left',
                            data: res.data.data.setMealNames
                        },
                        series: [//数据系列 {"data":{"setMealIncome":[{"name":"入职无忧体检套餐（男女通用）","value":300.0},{"name":"粉红珍爱(女)升级TM12项筛查体检套餐","value":4800.0},{"name":"阳光爸妈升级肿瘤12项筛查（男女单人）体检套餐","value":2800.0},{"name":"珍爱高端升级肿瘤12项筛查（男女单人）","value":4800.0},{"name":"总收入","value":12700}],"setMealNames":["入职无忧体检套餐（男女通用）","粉红珍爱(女)升级TM12项筛查体检套餐","阳光爸妈升级肿瘤12项筛查（男女单人）体检套餐","珍爱高端升级肿瘤12项筛查（男女单人）","总收入"]},"flag":true,"message":"预约统计数据成功"}
                            {
                                name: '套餐收入占比',
                                type: 'pie',//饼形图
                                radius: '55%',
                                center: ['50%', '60%'],
                                data: res.data.data.setMealIncome,
                                itemStyle: {
                                    emphasis: {
                                        shadowBlur: 10,
                                        shadowOffsetX: 0,
                                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                                    }
                                }
                            }
                        ]
                    });
                })
            }
        }
    });

</script>
</html>
